﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text;

namespace Acando.Dynamics.CRM.Silverlight.Library.Extensions
{
    public static class SimpleExtensions
    {
        public static String ToTitle(this String str)
        {
            StringBuilder strBuilder = new StringBuilder(str);

            strBuilder = strBuilder.Replace(strBuilder[0], Char.ToUpper(strBuilder[0]), 0, 1);
            
            return strBuilder.ToString();
        }

        public static Boolean IsNull(this Object obj)
        {
            return (obj == null);
        }

        public static Boolean IsNotNull(this Object obj)
        {
            return (obj != null);
        }

        public static int WordCount(this String str)
        {
            return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries).Length;
        }


    }
}
